﻿Option Explicit On
Option Strict On

Imports Microsoft.VisualBasic

Public Class GetPersonIdFromUserId
    Public Function GetPersonId(UserId As Guid) As Integer
        Dim personId As Integer = 0

        Dim personTA As New LogginsLogDSTableAdapters.PersonTableAdapter
        Dim personDT As New LogginsLogDS.PersonDataTable

        Try

            personDT = personTA.GetData(CType(UserId, Guid))
        Catch ex As Exception
            Throw ex
        End Try

        For Each personRow As LogginsLogDS.PersonRow In personDT
            personId = personRow.Id
        Next
        Return personId
    End Function
End Class
